@import '../../styles/theme.scss';

.layout {
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

// 动态背景装饰
.backgroundDecorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  
  // 主背景渐变
  background: linear-gradient(135deg, 
    var(--bg-secondary) 0%, 
    #f1f5f9 25%, 
    #e2e8f0 50%, 
    var(--bg-tertiary) 75%, 
    var(--bg-secondary) 100%
  );
  
  // 动态装饰球
  .decoration1 {
    position: absolute;
    width: 800px;
    height: 800px;
    background: var(--gradient-primary);
    border-radius: 50%;
    top: -300px;
    left: -200px;
    opacity: 0.1;
    filter: blur(100px);
    animation: float1 20s infinite ease-in-out;
  }
  
  .decoration2 {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    top: 50%;
    right: -150px;
    opacity: 0.08;
    filter: blur(80px);
    animation: float2 25s infinite ease-in-out;
  }
  
  .decoration3 {
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--gradient-blue);
    border-radius: 50%;
    bottom: -100px;
    left: 20%;
    opacity: 0.06;
    filter: blur(60px);
    animation: float3 30s infinite ease-in-out;
  }
  
  // 浮动图标
  .floatingIcons {
    position: absolute;
    width: 100%;
    height: 100%;
    
    .floatingIcon1 {
      position: absolute;
      top: 20%;
      left: 10%;
      font-size: 2rem;
      color: var(--primary-color);
      opacity: 0.3;
      animation: bounce1 6s infinite ease-in-out;
    }
    
    .floatingIcon2 {
      position: absolute;
      top: 60%;
      right: 15%;
      font-size: 1.5rem;
      color: var(--primary-light);
      opacity: 0.25;
      animation: bounce2 8s infinite ease-in-out;
    }
    
    .floatingIcon3 {
      position: absolute;
      bottom: 30%;
      left: 70%;
      font-size: 1.8rem;
      color: var(--primary-dark);
      opacity: 0.2;
      animation: bounce3 10s infinite ease-in-out;
    }
  }
  
  @keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(50px, -30px) scale(1.1) rotate(120deg); }
    66% { transform: translate(-30px, 50px) scale(0.9) rotate(240deg); }
  }
  
  @keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(-80px, 60px) scale(1.2) rotate(180deg); }
  }
  
  @keyframes float3 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(60px, -40px) scale(1.1) rotate(90deg); }
    75% { transform: translate(-40px, 30px) scale(0.8) rotate(270deg); }
  }
  
  @keyframes bounce1 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.1); }
  }
  
  @keyframes bounce2 {
    0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
    50% { transform: translateY(-15px) scale(1.05) rotate(180deg); }
  }
  
  @keyframes bounce3 {
    0%, 100% { transform: translateY(0) scale(1); }
    33% { transform: translateY(-10px) scale(1.08); }
    66% { transform: translateY(-5px) scale(0.95); }
  }
}

// 头部样式
.header {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0 !important;
  height: 80px !important;
  line-height: 80px !important;
  
  .headerContent {
    width: 100%;
    margin: 0;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
  }
  
  .left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0;
    
    .tagline {
      .taglineText {
        color: var(--primary-color);
        font-size: var(--font-size-sm);
        font-weight: 500;
        background: var(--gradient-primary);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
      }
    }
  }
  
  .navigation {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 var(--spacing-xl);
    
    .navLink {
      color: var(--primary-color) !important;
      font-weight: 500;
      font-size: var(--font-size-md);
      text-decoration: none !important;
      padding: var(--spacing-sm) var(--spacing-md);
      border-radius: var(--radius-md);
      transition: all var(--transition-fast);
      position: relative;
      
      &:hover {
        color: var(--primary-dark) !important;
        background: rgba(99, 102, 241, 0.1);
        transform: translateY(-1px);
      }
      
      &::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--gradient-primary);
        transform: translateX(-50%);
        transition: width var(--transition-fast);
      }
      
      &:hover::after {
        width: 80%;
      }
    }
  }
  
  .right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
}

// 主内容区域
.main {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 0 !important;
  background: transparent;
  overflow: hidden;
  min-height: 0;
  
  .contentWrapper {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    
    .mainContent {
      background: rgba(255, 255, 255, 0.7);
      backdrop-filter: blur(10px);
      border-radius: var(--radius-xl);
      border: 1px solid rgba(255, 255, 255, 0.3);
      box-shadow: var(--shadow-lg);
      flex: 1;
      overflow: hidden;
      width: 100%;
      max-width: none;
      display: flex;
      flex-direction: column;
      min-height: 0;
      
      // 为不同页面提供不同的内边距
      &:has([class*="Home"]) {
        background: transparent;
        backdrop-filter: none;
        border: none;
        box-shadow: none;
        padding: 0;
        overflow: visible;
      }
      
      &:has([class*="Login"]),
      &:has([class*="Register"]) {
        background: transparent;
        backdrop-filter: none;
        border: none;
        box-shadow: none;
        padding: 0;
      }
    }
  }
}


// 响应式设计
@media (max-width: 1200px) {
  .header .headerContent {
    padding: 0 var(--spacing-md);
  }
  
  .main .contentWrapper {
    padding: var(--spacing-md);
    width: 100%;
    height: 100%;
  }
  
  .footer .footerContent {
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-md);
  }
}

@media (max-width: 768px) {
  .header {
    height: 70px !important;
    line-height: 70px !important;
    
    .headerContent {
      flex-direction: column;
      height: auto;
      padding: var(--spacing-sm);
      gap: var(--spacing-sm);
    }
    
    .left {
      justify-content: center;
      
      .tagline {
        display: none;
      }
    }
    
    .navigation {
      width: 100%;
      justify-content: center;
      
      :global(.ant-space) {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
      }
      
      .navLink {
        font-size: var(--font-size-sm);
        padding: var(--spacing-xs) var(--spacing-sm);
      }
    }
    
    .right {
      width: 100%;
      justify-content: center;
    }
  }
  
  .main {
    flex: 1;
    
    .contentWrapper {
      height: 100%;
      
      .mainContent {
        border-radius: var(--radius-lg);
        flex: 1;
      }
    }
  }
  
  
  // 隐藏部分浮动装饰，减少移动端性能影响
  .backgroundDecorations {
    .decoration2,
    .decoration3 {
      display: none;
    }
    
    .floatingIcons {
      .floatingIcon2,
      .floatingIcon3 {
        display: none;
      }
    }
  }
}